home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / PyramidPoker.dxr / Internal_5_card behavior.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  1.3 KB  |  33 lines

  1. property spriteNum, card
  2. global stock, stack, playerHand, playerHandCount, miniCards, pootimer, win
  3.  
  4. on beginSprite me
  5.   sprite(spriteNum).visible = 1
  6.   card = sprite(spriteNum)
  7.   card.member = member(stock[1].rank & "_" & stock[1].suit, "playing cards")
  8.   stock.deleteAt(1)
  9.   stack.addProp(makesymbol(spriteNum), new(script("card"), spriteNum))
  10. end
  11.  
  12. on mouseDown me
  13.   if not getIntersect(spriteNum) then
  14.     puppetSound(3, member("pick card", "100GPak Generic SFX"))
  15.     playerHand[playerHandCount].add([getValue(card.member.name), getSuit(card.member.name)])
  16.     sprite(miniCards[playerHandCount][playerHand[playerHandCount].count]).member = member(sprite(spriteNum).member.name & "_mini", "mini cards")
  17.     sprite(spriteNum).visible = 0
  18.     if playerHand[playerHandCount].count = 5 then
  19.       playerHand[playerHandCount].sort()
  20.       getHand(playerHand[playerHandCount])
  21.       playerHandCount = playerHandCount + 1
  22.       if (playerHandCount = 11) and (member("hand" & string(playerHandCount - 1) & "text", "100Gpak Specific GFX").text <> "Busted!") then
  23.         win = "yes"
  24.         pootimer = timeout("kk").new(150, #gotoit)
  25.       end if
  26.     end if
  27.   else
  28.     if getIntersect(spriteNum) then
  29.       puppetSound(3, member("drop card", "100GPak Generic SFX"))
  30.     end if
  31.   end if
  32. end
  33.